package com.yixing.tech.wcs.constant;

public enum TaskTypeEnum {
    STOCK_IN("上架", DictId.TaskType.STOCK_IN, 1), STOCK_OUT("下架", DictId.TaskType.STOCK_OUT, 2),
    MOVING("移库", DictId.TaskType.MOVING, 3), TRANSPORT("搬运", DictId.TaskType.TRANSPORT, 4);

    private final String name;
    private final String code;

    private final Integer type;

    TaskTypeEnum(String name, String code, Integer type) {
        this.name = name;
        this.code = code;
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public String getCode() {
        return code;
    }

    public Integer getType() {
        return type;
    }

    public static TaskTypeEnum getFromCode(String code) {
        for(TaskTypeEnum taskType : TaskTypeEnum.values()) {
            if(taskType.getCode().equals(code))
                return taskType;
        }
        return null;
    }
}
